package com.yang.bean.yvo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yang.bean.MarketIssue;
import lombok.Data;

import java.util.Date;

/**
 * @author: 杨庆
 * @since: 2022.9.7 20:52
 * @description:
 */
@Data
public class IssueUpdateBO {
    private boolean deleted;
    private String question;
    private String answer;
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss",timezone = "GTM+8")
    private Date addTime;
    @JsonFormat(pattern = "yy-MM-dd HH:mm:ss",timezone = "GTM+8")
    private Date updateTime;
    private int id;


    public static MarketIssue getMarketIssue(IssueUpdateBO issueUpdateBO){
        MarketIssue marketIssue = new MarketIssue();
        marketIssue.setAddTime(issueUpdateBO.getAddTime());
        marketIssue.setAnswer(issueUpdateBO.getAnswer());
        marketIssue.setId(issueUpdateBO.getId());
        marketIssue.setUpdateTime(new Date());
        marketIssue.setQuestion(issueUpdateBO.getQuestion());
        marketIssue.setDeleted(issueUpdateBO.deleted);
        return marketIssue;
    }
}
